{% load i18n djangobmf_markup %}
<h1>{% trans "Product" %}: {{ object.name }}
    {% if object.code %}<small>{{ object.code }}</small>{% endif %}
</h1>
<ol class="breadcrumb">
    <li>{{ object.get_type_display }}</li>
    {% if object.can_sold %}<li>{% trans "sellable" %}</li>{% endif %}
    {% if object.can_purchased %}<li>{% trans "purchaseable" %}</li>{% endif %}
</ol>
<div class="row">
    <div class="col-lg-7">
        <div class="jumbotron text-right">
            <span class="h1">
                {{ calc_net }}
                {{ object.price_currency }}<br>
                <small>
                    {{ calc_gross }}
                    {{ object.price_currency }}
                </small>
            </span>
        </div>
    </div>
    <div class="col-lg-5">
        <h3>{% trans "Description" %}</h3>
        {{ object.description|bmfmarkup }}
    </div>
</div>

<h3>{% trans "Taxes" %}</h3>
<table class="table table-striped table-condensed table-hover">
    <tbody>
    {% for obj, value, related in taxes %}
        <tr>
            <td>{{ obj.name }}</td>
            <td class="text-right">{{ value }}</td>
            <td class="text-right">
                <a class="btn btn-xs bmfedit btn-bmfupdate" href="#?set-product={{ object.pk }}&amp;set-tax={{ obj.pk }}">
                  <span class="glyphicon glyphicon-wrench"></span>
                </a>
                <a class="btn btn-xs bmfedit btn-bmfdelete" href="#">
                  <span class="glyphicon glyphicon-trash"></span>
                </a>
              </a>
            </td>
        </tr>
    {% endfor %}
    </tbody>
    <tfoot>
        <tr>
            <td>
                <a class="btn btn-sm bmf-edit btn-bmfcreate" href="{% url "djangobmf:moduleapi_djangobmf_product_producttax:create" "default" %}?set-product={{ object.pk }}">
                    <span class="glyphicon glyphicon-plus"></span>
                    {% trans "Add" %}
                </a>
            </td>
            <td></td>
            <td></td>
        </tr>
    </foot>
</table>

<div class="row">
    <div class="col-sm-6">
        <h3>{% trans "Income" %}</h3>
        <p>
            <a href="{{ object.income_account.bmfmodule_detail }}">{{ object.income_account }}</a>
        </p>
    </div>
    <div class="col-sm-6">
        <h3>{% trans "Expense account" %}</h3>
        <p>
            <a href="{{ object.expense_account.bmfmodule_detail }}">{{ object.expense_account }}</a>
        </p>
    </div>
</div>
